﻿#pragma once

#include "../common.h"
#include "../effect.h"

namespace anip
{
	class Shader;
	class Context;
	class Texture2D;
	class RenderBuffer;

	class NoiseEffect : public Effect
	{
	private:
		RenderBuffer* _target;
		Shader* _shader;
		bool _iscolor;
		string _name;

	public:
		static const int pSeed = 0;
		static const int pOutput = 0;
		
		NoiseEffect(int w, int h, bool isColor = true);

		const string name() const { return _name; }

		const ParameterInfo& inputs()
		{
			static const string floatNames[1] = { "seed" };
			static const ParameterInfo info = {
				1, 0, 0, 0, 0, 0,
				floatNames, nullptr, nullptr, nullptr, nullptr, nullptr
			};
			return info;
		}

		const ParameterInfo& outputs()
		{
			static const string texNames[1] = { "output" };
			static const ParameterInfo info = {
				0, 0, 0, 0, 0, 1,
				nullptr, nullptr, nullptr, nullptr, nullptr, texNames
			};
			return info;
		}

		void initialize();

		void process(const Context& cxt);

		void finalize();
	};
}